Skip to content

Conversation

@marcelinollano
Copy link
Collaborator

What does this PR do?

Rewrites the agent generate authoring-bundle interactive flow to use a wizard-style pattern that mirrors the VS Code extension. Replaces the autocomplete spec selector with a two-step approach (template type picker → YAML spec file picker from specs/ directory), adds MultiStageOutput progress reporting, and updates all user-facing prompt text. Includes 18 unit tests covering the full wizard flow.

What issues does this PR fix or reference?

@W-21220749@

Functionality Before

  • Spec selection used autocomplete searching the whole project for *AgentSpec.yml/yaml files
  • Single-step spec selection with "Default Agent Spec" as a fallback option
  • No progress reporting during bundle generation
  • Prompt text was generic (e.g., "Name (label) of the authoring bundle")

Functionality After

  • Two-step spec selection: first choose template type ("Default template" or "From YAML spec"), then pick a specific file from specs/ directory
  • MultiStageOutput progress stages: "Creating authoring bundle structure..." → "Generating Agent Script file..." → "Complete!"
  • Refined prompt text: "Select authoring bundle template", "Enter authoring bundle name", "Enter authoring bundle API name"
  • Test spec files (-testSpec) are filtered out of the spec file list

Testing Setup Notes

  1. Ensure a specs/ directory exists at the project root with .yaml/.yml files
  2. Run sf agent generate authoring-bundle interactively to verify:
    • Template type selection appears with correct options
    • Spec file selection shows only when "From YAML spec" is chosen
    • Name and API name prompts appear with correct text
    • Progress stages display during generation
  3. Test flag-based usage: sf agent generate authoring-bundle --no-spec --name "Test" --api-name TestAgent --target-org <org>
  4. Test --spec with a direct path to verify it bypasses wizard prompts
  5. Unit tests: npx mocha "test/commands/agent/generate/authoring-bundle.test.ts"

Replace autocomplete spec selector with two-step type picker and file
picker from specs/ directory. Remove interactive API name prompt in
favor of auto-generation. Add MultiStageOutput progress reporting.
Add 18 unit tests covering flag-based usage, interactive wizard
prompts, name/API name validation, error handling, and spec file
filtering. Also restore the interactive API name prompt and refine
wizard prompt text.
@marcelinollano marcelinollano requested a review from a team as a code owner February 10, 2026 19:44
Copy link
Contributor

@jshackell-sfdc jshackell-sfdc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my edits. NOTE that I'm not sure where these messages really appear, so I'm making a guess. Please fix things like incorrect punctuation (like me adding a period when there shouldn't be), etc.

# error.failed-to-create-agent

Failed to create an authoring bundle from the agent spec YAML file.
Failed to generate authoring bundle: %s
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Failed to generate authoring bundle: %s
Failed to generate authoring bundle: %s.


# wizard.specType.prompt

Select authoring bundle template
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Select authoring bundle template
Select an authoring bundle template


# wizard.specType.option.default.name

Default template (recommended)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Default template (recommended)
Default template (Recommended)


# wizard.specType.option.fromSpec.name

From YAML spec (advanced)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
From YAML spec (advanced)
From an agent spec YAML file (Advanced)


# wizard.specType.option.default.description

Start with a ready-to-use Agent Script template
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Start with a ready-to-use Agent Script template
Start with a ready-to-use Agent Script template.


# wizard.specFile.prompt

Select authoring bundle YAML spec
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Select authoring bundle YAML spec
Select the agent spec YAML file.


# wizard.name.prompt

Enter authoring bundle name
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Enter authoring bundle name
Enter the authoring bundle name.


# wizard.name.validation.required

Bundle name is required
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Bundle name is required
Authoring bundle name is required.


# wizard.name.validation.empty

Bundle name can't be empty.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Bundle name can't be empty.
Authroring bundle name can't be empty.


# warning.noSpecDir

No agent spec directory found at %s
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
No agent spec directory found at %s
No agent spec directory found at %s.

Copy link
Contributor

@WillieRuemmele WillieRuemmele left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all seems fine, personally, I feel that the MSO is excessive, given it's a 17ms operation

 ──── Generating authoring bundle: my_agent_2 ────

 ✔ Creating authoring bundle structure... 4ms
 ✔ Generating Agent Script file... 5ms
 ✔ Complete! 0ms

 Elapsed Time: 17ms

@marcelinollano marcelinollano merged commit e750805 into main Feb 10, 2026
15 checks passed
@marcelinollano marcelinollano deleted the ml/W-21220749-agent-creation-cli-interview branch February 10, 2026 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants